package treeedit;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.net.URL;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JWindow;

public class About extends JWindow implements MouseListener
{
	JLabel label1 = new JLabel();
	JLabel label2 = new JLabel();
	JPanel panel = new JPanel();
	
	public About(String filename, Frame f)
    {
        super(f);

        URL url = Splash.class.getResource(filename);
                
		JLabel l = new JLabel(new ImageIcon(url));
		
		label1.setText("Konrad");
		label2.setText("Marcin");
		label1.setOpaque(true);
		label2.setOpaque(true);
				
		label1.setBorder(BorderFactory.createEtchedBorder());
		label2.setBorder(BorderFactory.createEtchedBorder());
		panel.setOpaque(true);
		
		panel.setLayout(new GridLayout(2,1));
		panel.add(label1);
		panel.add(label2);
		
		getContentPane().add(l, BorderLayout.CENTER);
        getContentPane().add(panel,BorderLayout.SOUTH);
        pack();
        Dimension screenSize =
          Toolkit.getDefaultToolkit().getScreenSize();
        Dimension labelSize = l.getPreferredSize();
        setLocation(screenSize.width/2 - (labelSize.width/2),
                    screenSize.height/2 - (labelSize.height/2));
        addMouseListener(this);
        setVisible(true);
        
        
    }
	
	
	

	public void mouseClicked(MouseEvent arg0) 
	{
		setVisible(false);
		dispose();
	}

	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
